package com.gk.study.common;

//public enum CourseStatus {
//    PENDING,     // 待确认
//    PROGRESS,    // 进行中
//    COMPLETED,   // 已结束
//    CANCELED     // 已取消
//}


public enum CourseStatus {
    PENDING("pending"),
    PROGRESS("progress"),
    COMPLETED("completed"),
    CANCELED("canceled");



    private final String value;

    CourseStatus(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public static CourseStatus fromValue(String value) {
        for (CourseStatus status : CourseStatus.values()) {
            if (status.value.equalsIgnoreCase(value)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid status: " + value);
    }


}